home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4410 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.2 KB

  1. Path: news.primenet.com!not-for-mail
  2. From: Mike Landmeier <PosLogc@primenet.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Q: how to handle currency?
  5. Date: 29 Jan 1996 16:37:01 -0700
  6. Organization: PosLogic
  7. Sender: root@primenet.com
  8. Message-ID: <310D5A3F.1DF@primenet.com>
  9. References: <4e93he$ec@sun.cis.smu.edu>
  10. X-Posted-By: ip101.phx.primenet.com
  11. X-Mailer: Mozilla 2.0b3 (WinNT; I)
  12. MIME-Version: 1.0
  13. Content-Type: text/plain; charset=us-ascii
  14. Content-Transfer-Encoding: 7bit
  15.  
  16. Damon Bowman wrote:
  17. > Another beginner question:
  18. > What data type is used for currency when you want "precision as
  19. > displayed?"  When using the float or double data types, you run into
  20. > the problem of imprecision.  In other words, I want to actually round
  21. > off my numbers when necessary to create real amounts of EXACTLY 47.23,
  22. > or whatever the case may be.
  23. > One of my books suggests that there is a method of doing this with
  24. > integers, but it does not go into any detail.
  25. > Any assistance is appreciated.
  26.  
  27.  
  28. Using MFC4.0 you can take advantage of COleCurrency where you 
  29. will get a 64 bit integer with 4 digits of precision.  This is 
  30. the same format as used by visual basic.
  31.  
  32. Mike Landmeier
  33. PosLogic
  34.